summaryrefslogtreecommitdiffstats
path: root/src/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.c')
-rw-r--r--src/lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib.c b/src/lib.c
index b6a5f3a..5a611a3 100644
--- a/src/lib.c
+++ b/src/lib.c
@@ -4,7 +4,7 @@ struct writefunc_string {
};
void init_writefunc_string(struct writefunc_string *s) {
s->len = 0;
- s->ptr = malloc(s->len+1);
+ s->ptr = malloc(s->len+1+250);
if (s->ptr == NULL) {
fprintf(stderr, "malloc() " DC_I18N_FAILED "\n");
exit(EXIT_FAILURE);
@@ -13,7 +13,7 @@ void init_writefunc_string(struct writefunc_string *s) {
}
size_t writefunc(void *ptr, size_t size, size_t nmemb, struct writefunc_string *s) {
size_t new_len = s->len + size*nmemb;
- s->ptr = realloc(s->ptr, new_len+1);
+ s->ptr = realloc(s->ptr, new_len+1+250);
if (s->ptr == NULL) {
fprintf(stderr, "realloc() " DC_I18N_FAILED "\n");
exit(EXIT_FAILURE);